package net.steam.easyjoboa.biz.impl;

import java.util.List;

import net.steam.easyjoboa.biz.VoteItemBiz;
import net.steam.easyjoboa.dao.VoteItemDao;
import net.steam.easyjoboa.entity.VoteItem;

public class VoteItemBizImpl implements VoteItemBiz {

	private VoteItemDao voteItemDao;
	
	public void addVoteItem(VoteItem voteItem) {
		try {
			voteItemDao.addEntity(voteItem);
		} catch (Exception e) {
			e.printStackTrace();
		}		
	}

	public List<VoteItem> getVoteItemsByUserId(int id,int voteId) {
		String hql = "from VoteItem where employee.userId="+id+" and vote.voteId="+voteId;
		return voteItemDao.find(hql);		
	}
	
	
	public void setVoteItemDao(VoteItemDao voteItemDao) {
		this.voteItemDao = voteItemDao;
	}

	
}
